;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 3.2.0 #8008 (Jul 27 2012) (Linux)
; This file was generated Thu Jun 20 19:22:26 2013
;--------------------------------------------------------
; PIC port for the 14-bit core
;--------------------------------------------------------
	.file	"delay16.c"
	list	p=16f819
	radix dec
	include "p16f819.inc"
;--------------------------------------------------------
; external declarations
;--------------------------------------------------------
	extern	__mulint

	extern PSAVE
	extern SSAVE
	extern WSAVE
	extern STK12
	extern STK11
	extern STK10
	extern STK09
	extern STK08
	extern STK07
	extern STK06
	extern STK05
	extern STK04
	extern STK03
	extern STK02
	extern STK01
	extern STK00
;--------------------------------------------------------
; global declarations
;--------------------------------------------------------
	global	_delay_ms
	global	_delay_us

;--------------------------------------------------------
; global definitions
;--------------------------------------------------------
;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
UDL_delay16_0	udata
r0x1001	res	1
r0x1000	res	1
r0x1002	res	1
r0x1003	res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	udata_ovr
;--------------------------------------------------------
; code
;--------------------------------------------------------
code_delay16	code
;***
;  pBlock Stats: dbName = C
;***
;entry:  _delay_ms	;Function start
; 2 exit points
;has an exit
;functions called:
;   __mulint
;   _delay_us
;   __mulint
;   _delay_us
;7 compiler assigned registers:
;   r0x1000
;   STK00
;   r0x1001
;   STK02
;   STK01
;   r0x1002
;   r0x1003
;; Starting pCode block
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2757:genLabel *{*
;; ***	genLabel  2760
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2339:genFunction *{*
;; ***	genFunction  2341 curr label offset=4previous max_key=0 
_delay_ms	;Function start
; 2 exit points
;;; gen.c:2315:resultRemat *{*
;;; gen.c:7339:genReceive *{*
;; ***	genReceive  7340
;;	694 register type nRegs=2
;;; gen.c:1906:assignResultValue *{*
;; ***	assignResultValue  1908
;; 	line = 1910 result -=-, size=0, left AOP_REG=r0x1048, size=2, right -=-, size=0
;; >>> gen.c:1392:movwf
;;	1108 rIdx = r0x1049 
	.line	29; "delay16.c"	void delay_ms(int ms)
	BANKSEL	r0x1000
	MOVWF	r0x1000
;; >>> gen.c:1422:get_returnvalue
;; ***	popRegFromIdx,1042  , rIdx=0x7f
	MOVF	STK00,W
;; >>> gen.c:1392:movwf
;;	1108 rIdx = r0x1048 
	.line	35; "delay16.c"	unsigned int k = ms * 10;
	MOVWF	r0x1001
	MOVWF	STK02
;;; gen.c:1342:mov2w_op *{*
;; ***	mov2w  1380  offset=1
;; >>> gen.c:1385:mov2w
;;	1108 rIdx = r0x1049 
	MOVF	r0x1000,W
;; 	2134 left AOP_LIT
;; >>> gen.c:2142:genCall
;; ***	popRegFromIdx,1042  , rIdx=0x7e
	MOVWF	STK01
;;; gen.c:1342:mov2w_op *{*
;; >>> gen.c:1360:mov2w_op
	MOVLW	0x0a
;; 	2134 left AOP_LIT
;; >>> gen.c:2142:genCall
;; ***	popRegFromIdx,1042  , rIdx=0x7f
	MOVWF	STK00
;;; gen.c:1342:mov2w_op *{*
;; >>> gen.c:1360:mov2w_op
	MOVLW	0x00
;; >>> gen.c:2172:genCall
	PAGESEL	__mulint
;; >>> gen.c:2174:genCall
	CALL	__mulint
;; >>> gen.c:2180:genCall
	PAGESEL	$
;;	694 register type nRegs=2
;;; gen.c:1906:assignResultValue *{*
;; ***	assignResultValue  1908
;; 	line = 1910 result -=-, size=0, left AOP_REG=r0x1048, size=2, right -=-, size=0
;; >>> gen.c:1392:movwf
;;	1108 rIdx = r0x1049 
	BANKSEL	r0x1000
	MOVWF	r0x1000
;; >>> gen.c:1422:get_returnvalue
;; ***	popRegFromIdx,1042  , rIdx=0x7f
	MOVF	STK00,W
;; >>> gen.c:1392:movwf
;;	1108 rIdx = r0x1048 
	MOVWF	r0x1001
;; 	2194 left AOP_REG
;;; gen.c:1844:unsaveRegisters *{*
;; ***	unsaveRegisters  1846
;;; gen.c:2315:resultRemat *{*
;;; gen.c:6908:genAssign *{*
;; ***	genAssign  6909
;;	694 register type nRegs=2
;; 	line = 6918 result AOP_REG=r0x104A, size=2, left -=-, size=0, right AOP_LIT=0x00, size=2
;; ***	genAssign  7004
;; >>> gen.c:7016:genAssign
;;	1108 rIdx = r0x104A 
	.line	37; "delay16.c"	for (j=0; j<k; j++)
	CLRF	r0x1002
;; ***	genAssign  7004
;; >>> gen.c:7016:genAssign
;;	1108 rIdx = r0x104B 
	CLRF	r0x1003
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2757:genLabel *{*
;; ***	genLabel  2760
;;; gen.c:2315:resultRemat *{*
;;; gen.c:3580:genCmpLt *{*
;; ***	genCmpLt  3581
;;	694 register type nRegs=2
;;	694 register type nRegs=2
;;; gen.c:3291:genCmp *{*
;; >>> gen.c:3266:pic14_mov2w_regOrLit
;;	1108 rIdx = r0x1049 
_00109_DS_
	BANKSEL	r0x1000
	MOVF	r0x1000,W
;; >>> gen.c:3429:genCmp
;;	1108 rIdx = r0x104B 
	SUBWF	r0x1003,W
;; >>> gen.c:3474:genCmp
	BTFSS	STATUS,2
;; >>> gen.c:3475:genCmp
;; ***	popGetLabel  key=12, label offset 8
	GOTO	_00120_DS_
;; >>> gen.c:3266:pic14_mov2w_regOrLit
;;	1108 rIdx = r0x1048 
	MOVF	r0x1001,W
;; >>> gen.c:3477:genCmp
;;	1108 rIdx = r0x104A 
	SUBWF	r0x1002,W
;;; gen.c:3234:genSkipc *{*
;; >>> gen.c:3239:genSkipc
_00120_DS_
	BTFSC	STATUS,0
;; >>> gen.c:3243:genSkipc
;; ***	popGetLabel  key=5, label offset 8
	GOTO	_00113_DS_
;;genSkipc:3244: created from rifx:0x7fff9c8fbd50
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2085:genCall *{*
;; ***	genCall  2087
;;; gen.c:1800:saveRegisters *{*
;; ***	saveRegisters  1802
;; 	2134 left AOP_LIT
;;; gen.c:1342:mov2w_op *{*
;; >>> gen.c:1360:mov2w_op
	.line	39; "delay16.c"	delay_us (33);       //101µs
	MOVLW	0x21
;; >>> gen.c:2174:genCall
	CALL	_delay_us
;;; gen.c:1844:unsaveRegisters *{*
;; ***	unsaveRegisters  1846
;;; gen.c:2315:resultRemat *{*
;; ***	genPlus  576
;;; genarith.c:577:genPlus *{*
;;	694 register type nRegs=2
;;	575
;; 	line = 583 result AOP_REG=r0x104A, size=2, left AOP_REG=r0x104A, size=2, right AOP_LIT=0x01, size=1
;;; genarith.c:142:genPlusIncr *{*
;; ***	genPlusIncr  144
;; 	result AOP_REG, left AOP_REG, right AOP_LIT
;; 	genPlusIncr  156
;; >>> genarith.c:168:genPlusIncr
;;	1108 rIdx = r0x104A 
	.line	37; "delay16.c"	for (j=0; j<k; j++)
	BANKSEL	r0x1002
	INCF	r0x1002,F
;; >>> genarith.c:172:genPlusIncr
	BTFSC	STATUS,2
;; >>> genarith.c:173:genPlusIncr
;;	1108 rIdx = r0x104B 
	INCF	r0x1003,F
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2775:genGoto *{*
;; >>> gen.c:2777:genGoto
;; ***	popGetLabel  key=1, label offset 8
	GOTO	_00109_DS_
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2757:genLabel *{*
;; ***	genLabel  2760
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2522:genEndFunction *{*
;; ***	genEndFunction  2524
_00113_DS_
	RETURN	
; exit point of _delay_ms

;***
;  pBlock Stats: dbName = C
;***
;entry:  _delay_us	;Function start
; 2 exit points
;has an exit
;; Starting pCode block
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2757:genLabel *{*
;; ***	genLabel  2760
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2339:genFunction *{*
;; ***	genFunction  2341 curr label offset=0previous max_key=0 
_delay_us	;Function start
; 2 exit points
;;; gen.c:2315:resultRemat *{*
;;; gen.c:4741:pic14_genInline *{*
;; ***	pic14_genInline  4742
	sublw 1
bucle:
	ADDLW 1
	btfss 0x03,0
	goto bucle
	
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2757:genLabel *{*
;; ***	genLabel  2760
;;; gen.c:2315:resultRemat *{*
;;; gen.c:2522:genEndFunction *{*
;; ***	genEndFunction  2524
	RETURN	
; exit point of _delay_us
;;; gen.c:7407:genpic14Code *{*


;	code size estimation:
;	   31+    6 =    37 instructions (   86 byte)

	end
